<?php /* Smarty version 2.6.26, created on 2011-02-16 17:23:49
         compiled from admin/edit/service.html */ ?>
<form action="service.php" method="post">
    <input type="hidden" name="id" value="<?php if ($this->_tpl_vars['object']['srv_id'] != 0): ?><?php echo $this->_tpl_vars['object']['srv_id']; ?>
<?php else: ?><?php echo $this->_tpl_vars['object']['id']; ?>
<?php endif; ?>"/>
    <table>
	<tr>
	    <td align="right">Услуга:</td>
	    <td>
		<select name="service_name_id">
		<?php $_from = $this->_tpl_vars['service_names']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['sn']):
?>
		    <option value="<?php echo $this->_tpl_vars['sn']['id']; ?>
" <?php if ($this->_tpl_vars['object']['service_name_id'] == $this->_tpl_vars['sn']['id']): ?>selected<?php endif; ?>><?php echo $this->_tpl_vars['sn']['service_name']; ?>
</option>
		<?php endforeach; endif; unset($_from); ?>
		</select>

		<?php if ($this->_tpl_vars['object']['service_name_id'] == 3): ?>
		<table class="service-options ui-state-default" id="service-name-3">
		    <tr>
			<td align="right"><strong>Номер телефона:</strong></td>
			<td><input type="text" name="phone_number" value="<?php echo $this->_tpl_vars['object']['phone_number']; ?>
"/></td>
		    </tr>
		    <tr>
			<td align="right"><strong>Тариф:</strong></td>
			<td>
			    <select name="phone_rate_id">
			    <?php $_from = $this->_tpl_vars['phone_rates']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['rate']):
?>
				<option value="<?php echo $this->_tpl_vars['rate']['id']; ?>
" <?php if ($this->_tpl_vars['rate']['id'] == $this->_tpl_vars['object']['phone_rate_id']): ?>selected<?php endif; ?>><?php echo $this->_tpl_vars['rate']['rate_name']; ?>
</option>
			    <?php endforeach; endif; unset($_from); ?>
			    </select>
			</td>
		    </tr>
		</table>
		<?php endif; ?>
	    </td>
	</tr>
	<tr>
	    <td align="right">Исполнитель:</td>
	    <td>
		<select name="executive_id">
		<?php $_from = $this->_tpl_vars['executives']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['executive']):
?>
		    <option value="<?php echo $this->_tpl_vars['executive']['id']; ?>
" <?php if ($this->_tpl_vars['object']['executive_id'] == $this->_tpl_vars['executive']['id']): ?>selected<?php endif; ?>><?php echo $this->_tpl_vars['executive']['executive_name']; ?>
</option>
		<?php endforeach; endif; unset($_from); ?>
		</select>
	    </td>
	</tr>
	<tr>
	    <td align="right">Стоимость:</td>
	    <td><input type="text" name="cost" value="<?php echo $this->_tpl_vars['object']['cost']; ?>
"/></td>
	</tr>
	<tr>
	    <td align="right">Ежемесячная:</td>
	    <td><input type="checkbox" name="monthly" value="1" <?php if ($this->_tpl_vars['object']['monthly'] == 1): ?>checked<?php endif; ?>/></td>
	</tr>
	<tr>
	    <td align="right">Начало:</td>
	    <td><input type="text" name="start_date" value="<?php echo $this->_tpl_vars['object']['start_date']; ?>
"/></td>
	</tr>
	<tr>
	    <td align="right">Конец:</td>
	    <td><input type="text" name="stop_date" value="<?php echo $this->_tpl_vars['object']['stop_date']; ?>
"/></td>
	</tr>
	<tr>
	    <td colspan="2" align="center"><input type="submit" value="Сохранить"/></td>
	</tr>
    </table>
</form>